import React, { useCallback, useState } from 'react'
import './index.css'
export default function Clock() {
    const [totalTime, setTotalTime] = useState(30)
    let timer = setTimeout(() => {
        if (totalTime > 0) {
            setTotalTime(totalTime-1)

        } else {
            clearTimeout(timer)
        }
    }, 1000)
    return (
        <div className="ClockContainer"  >
            {totalTime}
        </div>
    )
}